package cn.yeziji.forum.dao.impl;

import cn.yeziji.forum.dao.base.ForumFriendlyLinkBaseDao;
import cn.yeziji.forum.dao.intf.ForumFriendlyLinkDao;
import cn.yeziji.forum.vo.friendlyLink.FriendlyLinkVO;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.stream.Collectors;

/**
 * 友情链接业务实现层
 *
 * @author gzkemays
 * @since 2022/11/11 9:31 PM
 */
@Service
public class ForumFriendlyLinkDaoImpl extends ForumFriendlyLinkBaseDao
    implements ForumFriendlyLinkDao {
  @Override
  public List<FriendlyLinkVO> list() {
    return mapper().listEntity(query().selectAll().where.delete().isFalse().end()).stream()
        .map(FriendlyLinkVO::new)
        .collect(Collectors.toList());
  }
}
